From 42db89c307a04b95c620142146d9095c3992a2af Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 6 Jan 2006 19:59:57 +0000 Subject: [PATCH] Correctly handle mpsmergeout option as a real binary option. --- gpsbabel/mapsource.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gpsbabel/mapsource.c b/gpsbabel/mapsource.c index a029285ca..0e57d1be8 100644 --- a/gpsbabel/mapsource.c +++ b/gpsbabel/mapsource.c @@ -68,7 +68,8 @@ static short_handle read_route_wpt_mkshort_handle; char *snlen = NULL; char *snwhiteopt = NULL; char *mpsverout = NULL; -char *mpsmergeout = NULL; +char *mpsmergeouts = NULL; +int mpsmergeout; char *mpsusedepth = NULL; char *mpsuseprox = NULL; @@ -80,7 +81,7 @@ arglist_t mps_args[] = { {"mpsverout", &mpsverout, "Version of mapsource file to generate (3,4,5)", NULL, ARGTYPE_INT }, - {"mpsmergeout", &mpsmergeout, "Merge output with existing file", + {"mpsmergeout", &mpsmergeouts, "Merge output with existing file", NULL, ARGTYPE_BOOL }, {"mpsusedepth", &mpsusedepth, "Use depth values on output (default is ignore)", NULL, @@ -296,10 +297,14 @@ mps_rd_deinit(void) static void mps_wr_init(const char *fname) { + if (mpsmergeouts) { + mpsmergeout = atoi(mpsmergeouts); + } + if (mpsmergeout) { mps_file_out = xfopen(fname, "rb", MYNAME); if (mps_file_out == NULL) { - mpsmergeout = NULL; + mpsmergeout = 0; } else { fclose(mps_file_out); -- 2.30.2